package com.example.pieces;

import android.content.Intent;
import android.content.SharedPreferences;
import android.nfc.Tag;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class SplashActivity extends AppCompatActivity {
    private static final String TAG ="SplashActivity" ;
    private EditText et_splash;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        et_splash= (EditText) findViewById(R.id.et_splash);
    }

    public void login(View view) {
        String username=et_splash.getText().toString();
        if (TextUtils.isEmpty(username)) {
            et_splash.setError("用户名不能为空");
        }else{
            Intent i=new Intent(SplashActivity.this,ListViewActivity.class);
            i.putExtra("username",username);
            startActivity(i);
            finish();
        }
    }
}
